Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 4 - Geometric Operations / About Geometric Operations


Reducing and Simplifying Shape Geometries

QuickDraw GX allows you to change shape geometries to simpler forms. You can reduce the number of geometric points in a shape by removing unnecessary ones. You can also simplify a shape's geometry by removing unnecessary contour breaks, eliminating crossed and overlapping contours, and even simplifying the shape's shape type, if possible.

Figure 4-6 shows the difference between reducing a shape's geometry and simplifying a shape's geometry.

Figure 4-6 Effects of reducing and simplifying shape geometries

In this figure, the polygon geometry has two unnecessary geometric points, which are removed in the reduced polygon. Since the polygon is actually a square, simplifying this polygon converts the polygon geometry to the simplest type of geometry necessary--which in this case is a rectangle geometry.

The path geometry in the lower part of Figure 4-6 has a crossed contour, but no unnecessary geometric points. Reducing this path results in the same path geometry, whereas simplifying this path reorders the geometric points and breaks the geometry into two path contours so that no contour crossing occurs. Also notice that, because the original path geometry starts with an off-curve control point, simplifying the path adds an initial on-curve geometric point. The new initial geometric point is halfway between the point that was originally at the end of the contour and the point that was originally at the beginning of the contour. Although adding this new complexity might not seem like a simplification, removing crossed contours does result in more predictable drawing results, as shown in Figure 4-7.

Figure 4-7 How simplifying a shape can produce more predictable results when drawing

Figure 4-7 shows the path geometry from Figure 4-6. When this path is drawn with a pen width of 10.0 and the inside-frame style attribute set, the upper half of the path is inset, but the lower half of the path is outset, because of the crossed contour. Simplifying the shape uncrosses the contour, which results in both halves of the path shape being inset when drawn.

For more examples of the effect of simplifying shapes on drawing, see the section "Simplifying Shapes" beginning on page 4-33, as well as in the pen placement examples in Chapter 3, "Geometric Styles," in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help